class Vector {
public:
    float x;
    float y;
    float z;

    Vector(float x, float y, float z) : x(x), y(y), z(z) {
    }

    Vector(const Vector& v) {
        x = v.x;
        y = v.y;
        z = v.z;
    }

    Vector operator + (Vector r) const {
        return Vector(x + r.x, y + r.y, z + r.z);
    }

    Vector operator - (const Vector& r) const {
        return Vector(x - r.x, y - r.y, z - r.z);
    }

    float dot(const Vector& r) const {
        return x * r.x + y * r.y + z * r.z;
    }

    float length();

    Vector operator * (float t) const {
        return Vector(x * t, y * t, z * t);
    }

    void normalize();
};

using Color = Vector;
